/*
 * =====================================================================================
 *
 *       Filename:  common.h
 *
 *    Description:  define common type
 *
 *        Version:  1.0
 *        Created:  2011年07月19日 00时18分08秒
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Chancey (CN), chanceycn@gmail.com
 *        Company:  
 *
 * =====================================================================================
 */
#ifndef SUGGEST_INCLUDED_COMMON_H
#define SUGGEST_INCLUDED_COMMON_H

#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>

#include <string>
#include <iostream>

#include <map>
#include <unordered_map>
#include <vector>
#include <list>
#include <iterator>

#include "log.h"

#include <glog/logging.h>
#include <Ice/Ice.h>
#include "sg_ice.h"

#include "lru_cache.h"

#define PINYIN_DELIM ','

typedef std::vector<std::string> VECTOR_STRING;
typedef std::map<std::string, uint64_t> MAP_STRING;
typedef std::unordered_map<std::string, suggestion::VectorUid> MAP_VEC;

typedef struct SG_INDEX
{
    std::string     text;
    uint64_t        index;
} SG;

typedef std::vector<SG> VECTOR_SG;

// cache type
typedef LRUCache<long, MAP_VEC> CACHE_MAP;

#endif
